[pft]@AHHEAD.PFT[/pft]
<script type="text/javascript">

    function validForm(){

        document.Option.action = "[pft]getenv('SCRIPT_NAME')v5000^d,'scripts/'[/pft]";

        if (document.Option.listOption[1].checked == true){ // hit range option
            var ref0 = parseFloat(document.Option.listHit[0].value);
            var ref1 = parseFloat(document.Option.listHit[1].value);

            if(document.Option.listHit[0].value.length == 0 || document.Option.listHit[1].value.length == 0 ) {
                alert("{{enter_print_range}}");
                return false;
            }
            if((ref0 > ref1) || isNaN(ref0) || isNaN(ref1) || ref0 <= 0 || ref1 <= 0) {
                alert("{{invalid_range}}");
                return false;
            }

            if(eval(document.Option.listHit[0].value) > [pft]v1002[/pft] || eval(document.Option.listHit[1].value) > [pft]v1002[/pft]) {
                alert("{{max_refs_allowed}}: [pft]v1002[/pft]");
                return false;
            }
        }
        if (document.Option.sendOption[1].checked == true){ // save option
            var ind  = document.Option.saveFileType.selectedIndex;
            var type = document.Option.saveFileType[ind].value;
            document.Option.sendOption[1].value = type;

            //document.Option.action += "list.";

            if (type == "iso" || type == "xml"){
                if (document.Option.listOption[0].checked == true){ // list_all
                    if ([pft]v1002[/pft] > 1000) {
                        alert("{{max_refs_allowed}}: 1000");
                        return false;
                    }
                }

                if (document.Option.listOption[1].checked == true){ // list_hits
                    if ((document.Option.listHit[1].value - document.Option.listHit[0].value) > 1000) {
                        alert("{{max_refs_allowed}}: 1000");
                        return false;
                    }
                }
             }
             /*
             if (navigator.appName.indexOf("Microsoft") == -1) {
                 // se nao eh browser Microsoft adiciona extensao
                    document.Option.action += type;
             }
             */
        }
        if (document.Option.sendOption[2].checked == true){ // email option
            email = document.Option.sendToEmail.value
            if (email.length == 0){
                alert("{{send_for_email}}");
                return false;
            }
            isGood = (email.indexOf("@")  != "-1") &&
                     (email.indexOf(".")  != "-1") &&
                     (email.indexOf("@.") == "-1") &&
                     (email.indexOf(" ")  == "-1") &&
                     (email.indexOf(";")  == "-1") &&
                     (email.indexOf(",")  == "-1") &&
                     (email.indexOf("?")  == "-1") &&
                     (email.length > 5);

            if (!isGood) {
                alert("{{invalid_email}}")
                return false;
            }
        }
    }
</script>
<form action="[pft]getenv('SCRIPT_NAME')v5000^d,'scripts/'[/pft]" method="POST" name="Option" onSubmit="return validForm()">
    [pft]@AHHIDD.PFT[/pft]

    <input type="hidden" name="nextAction" value="list" />
    <!--
    [pft]'5018=',v5018[/pft]
    -->

        <div class="barNav">
            <div class="leftCol">&nbsp;</div>
            <div class="centerCol"><b>{{send_result}}</b></div>
            <div class="rightCol">&nbsp;</div>
        </div>
        <div class="row">&nbsp;</div>

    <div class="contBorder">

        <div class="celLeft"><b>{{which_references}}</b></div>

        <div class="celRight">
            <div class="rowHigh">
                    <input type="Radio" name="listOption" value="list_all" [pft]if a(v6210) then 'checked' fi[/pft] />
                {{all_references}} ([pft]v1002[/pft])
            </div>
            <div class="rowHigh">
                    <input type="Radio" name="listOption" value="list_hits" />
                {{range_of_references}}
                    <input type="text" name="listHit" maxlength="6" size="4" onFocus="document.Option.listOption[1].checked = true" />
                <span class="labl">&nbsp;-&nbsp;</span>
                <input type="text" name="listHit" maxlength="6" size="4" onFocus="document.Option.listOption[1].checked = true" />
            </div>
            <div class="rowHigh">
                    [pft]if p(v6210) then[/pft]
                        <input type="Radio" name="listOption" value="list_selected" checked />
                    [pft]else[/pft]
                        &nbsp;<img src="[pft]v5002[/pft]radio.gif" border="0" />
                    [pft]fi[/pft]
                {{selected_references}} [pft]if p(v6210) then '('f(nocc(v6210),1,0)')' fi[/pft]
            </div>
        </div>

    </div>

    <div class="rowHigh">&nbsp;</div>

    <div class="contBorder">

        <div class="celLeft"><b>{{sending_options}}</b></div>

        <div class="celRight">
            <div class="rowHigh">
                <input type="Radio" name="sendOption" value="print" checked />&nbsp;{{send_for_print}}
            </div>
            <div class="rowHigh">
                <input type="Radio" name="sendOption" value="save" />&nbsp;{{save_result}}&nbsp;
            <select name="saveFileType" onFocus="document.Option.sendOption[1].checked = true">
            [pft]if v5018^f : 'XML' then[/pft]
                    <option value="save-xml">XML</option>
            [pft]fi[/pft]
            <option value="save-html">HTML</option>
            <option value="export-iso">ISO 2709 (MicroIsis)</option>
            [pft]
                (if v5005^t = 'EXPORT' then '<option value="export-',v5005^n,'">',v5005^p,'</option>/' fi)
            [/pft]
                </select>
            </div>

            [pft]if v5018^e = 'ON' then[/pft]
            <div class="rowHigh">
                <input type="Radio" name="sendOption" value="e-mail" />&nbsp;{{send_for_email}}:&nbsp;&nbsp;
                <input type="text" name="sendToEmail" size="35" onFocus="document.Option.sendOption[2].checked = true" />
            </div>
            [pft]else[/pft]
            <div class="rowHigh">&nbsp;</div>
            [pft]fi[/pft]
        </div>

    </div>

    <div class="row">&nbsp;</div>

            <div class="rowAction">
                <div class="leftCol">&nbsp;</div>
                <div class="centerCol">
                    <input type="button" class="defaultButton submit" value="{{cancel}}" name="cancel" onclick="javascript:history.back()" />

                    <input type="submit" class="defaultButton submit" value="{{send}}" />
            </div>
                <div class="rightCol">&nbsp;</div>                
            </div>

</form>
</div>      <!-- content end -->
</body>
</html>
